package com.woniuxy01;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

public class Test01 {
    public static void main(String[] args) {
        LocalDate date = LocalDate.now();
        System.out.println(date);
        LocalTime time = LocalTime.now();
        System.out.println(time);
        LocalDateTime dateTime = LocalDateTime.now();
        System.out.println(dateTime);
        //获取日期的某个部分
        System.out.println(dateTime.getMonth());
        System.out.println(dateTime.getMonthValue());
        //日期运算
        System.out.println(dateTime.plusYears(1));
        System.out.println(dateTime.plusYears(-1));
        System.out.println(dateTime.minusMonths(1));
    }
}
